D['MIc'] <- round((1 - (1-D$MI.treat/100)/(1-D$MI.control/100))*100,2)
print(D['MIc'])
Dz <- D[c('zone.1', 'zone.2', 'zone.3'),]
Dz
Dl <- D['laboratory',]
Dl
Z <- D[c('zone.1', 'zone.2', 'zone.3'),]
L <- D['laboratory',]
t.test(Z$MIc, mu=MI.ref, alternative ="less")
Z <- D[c('zone.1', 'zone.2', 'zone.3'),]
L <- D['laboratory',]
MIc <- Z['MIc']
t.test(MIc, mu=MI.ref, alternative ="less")
t.test(MIc, mu=L$MIc, alternative ="less")
knitr::opts_chunk$set(echo = TRUE)
library(DescTools)
library(ggplot2)
theme_set(theme_bw())
D <- data.frame(N.treat   = c(1048, 1111, 1174, 654),
N.control = c(175, 159, 160, 157),
MI.treat  = c(91.79, 97.03, 94.63, 98.01),
MI.control = c(1.71, 15.09, 6.25, 14.01))
row.names(D) <- c("zone.1", "zone.2", "zone.3", "laboratory")
print(D)
D['MIc'] <- round((1 - (1-D$MI.treat/100)/(1-D$MI.control/100))*100,2)
print(D['MIc'])
Z <- D[c('zone.1', 'zone.2', 'zone.3'),]
MIc.zone <- Z['MIc']
t.test(MIc, mu=MI.ref, alternative ="less")
MIc.lab <- D['laboratory','MIc']
t.test(MIc, mu=L$MIc, alternative ="less")
MIc.lab <- D['laboratory','MIc']
t.test(MIc.zone, mu=MIc.lab, alternative ="less")
knitr::opts_chunk$set(echo = TRUE)
library(DescTools)
library(ggplot2)
theme_set(theme_bw())
D <- data.frame(N.treat   = c(1048, 1111, 1174, 654),
N.control = c(175, 159, 160, 157),
MI.treat  = c(91.79, 97.03, 94.63, 98.01),
MI.control = c(1.71, 15.09, 6.25, 14.01))
row.names(D) <- c("zone.1", "zone.2", "zone.3", "laboratory")
print(D)
D['MIc'] <- round((1 - (1-D$MI.treat/100)/(1-D$MI.control/100))*100,2)
print(D['MIc'])
D.field <- D[c('zone.1', 'zone.2', 'zone.3'),]
MIc.field <- D.field['MIc']
t.test(MIc, mu=MI.ref, alternative ="less")
MIc.lab <- D['laboratory','MIc']
t.test(MIc.field, mu=MIc.lab, alternative ="less")
t.test(MIc.field, mu=91, alternative ="greater")
wilcox.test(MIc.field, mu=MI.ref, alternative ="less")
MIc.field
knitr::opts_chunk$set(echo = TRUE)
library(DescTools)
library(ggplot2)
theme_set(theme_bw())
D <- data.frame(N.treat   = c(1048, 1111, 1174, 654),
N.control = c(175, 159, 160, 157),
MI.treat  = c(91.79, 97.03, 94.63, 98.01),
MI.control = c(1.71, 15.09, 6.25, 14.01))
row.names(D) <- c("zone.1", "zone.2", "zone.3", "laboratory")
print(D)
D['MIc'] <- round((1 - (1-D$MI.treat/100)/(1-D$MI.control/100))*100,2)
print(D['MIc'])
D.field <- D[c('zone.1', 'zone.2', 'zone.3'),]
MIc.field <- D.field[['MIc']]
t.test(MIc, mu=MI.ref, alternative ="less")
MIc.lab <- D['laboratory','MIc']
t.test(MIc.field, mu=MIc.lab, alternative ="less")
wilcox.test(MIc.field, mu=MI.ref, alternative ="less")
x <- seq(90,104,by=0.1)
sd.MIc <- sd(MIc.field)/sqrt(length(MIc.field))
r <- data.frame(x=x, y=dnorm(x, MI.ref, sd.MIc))
ggplot(D.field) + geom_point(aes(x=MIc,y=0), color="red", size=5) +
geom_line(data=r, aes(x,y)) + geom_vline(xintercept = 100, colour='red', size=1)
t.test(log(MIc.field/(100-MIc.field)), mu=log(MI.ref/(100-MI.ref)), alternative ="less")
t.test(log(MIc.field/(100-MIc.field)), mu=log(MIc.lab/(100-MIc.lab)), alternative ="less")
MIl <- log(MIc.field/(100-MIc.field))
d <- data.frame(MIl,y=0)
x <- seq(2.3,5.5,by=0.01)
r <- data.frame(x=x, y=dnorm(x, log(MIc.lab/(100-MIc.lab)), sd(MIl)/sqrt(length(MIl))))
ggplot(d) + geom_point(aes(MIl,y), color="red", size=5) +
geom_line(data=r, aes(x,y))
MIl <- log(MIc.field/(100-MIc.field))
d <- data.frame(MIl,y=0)
x <- seq(2.3,5.5,by=0.01)
r <- data.frame(x=x, y=dnorm(x, log(MIc.lab/(100-MIc.lab)), sd(MIl)/sqrt(length(MIl))))
ggplot(d) + geom_point(aes(MIl,y), color="red", size=5) +
geom_line(data=r, aes(x,y)) + xlab('logit(MIc.field))
MIl <- log(MIc.field/(100-MIc.field))
d <- data.frame(MIl,y=0)
x <- seq(2.3,5.5,by=0.01)
r <- data.frame(x=x, y=dnorm(x, log(MIc.lab/(100-MIc.lab)), sd(MIl)/sqrt(length(MIl))))
ggplot(d) + geom_point(aes(MIl,y), color="red", size=5) +
geom_line(data=r, aes(x,y)) + xlab('logit(MIc.field'))
MIl <- log(MIc.field/(100-MIc.field))
d <- data.frame(MIl,y=0)
x <- seq(2.3,5.5,by=0.01)
r <- data.frame(x=x, y=dnorm(x, log(MIc.lab/(100-MIc.lab)), sd(MIl)/sqrt(length(MIl))))
ggplot(d) + geom_point(aes(MIl,y), color="red", size=5) +
geom_line(data=r, aes(x,y)) + xlab('logit(MIc.field)')
MIl <- log(MIc.field/(100-MIc.field))
d <- data.frame(MIl,y=0)
x <- seq(2.3,5.5,by=0.01)
r <- data.frame(x=x, y=dnorm(x, log(MIc.lab/(100-MIc.lab)), sd(MIl)/sqrt(length(MIl))))
ggplot(d) + geom_point(aes(MIl,y), color="red", size=5) +
geom_line(data=r, aes(x,y)) + xlab('logit_100(MIc.field)')
x <- seq(90,104,by=0.1)
sd.MIc <- sd(MIc.field)/sqrt(length(MIc.field))
r <- data.frame(x=x, y=dnorm(x, MI.ref, sd.MIc))
ggplot(D.field) + geom_point(aes(x=MIc,y=0), color="red", size=5) +
geom_line(data=r, aes(x,y)) + geom_vline(xintercept = 100, colour='red', size=1)  + ylab('pdf')
MIl <- log(MIc.field/(100-MIc.field))
d <- data.frame(MIl,y=0)
x <- seq(2.3,5.5,by=0.01)
r <- data.frame(x=x, y=dnorm(x, log(MIc.lab/(100-MIc.lab)), sd(MIl)/sqrt(length(MIl))))
ggplot(d) + geom_point(aes(MIl,y), color="red", size=5) +
geom_line(data=r, aes(x,y)) + xlab('logit(MIc.field)') + ylab('pdf')
sd.ref <- sqrt(MI.ref*(100-MI.ref)/D.field$N.treat)
D.field$p.ref <- pnorm(D.field$MIc, MI.ref, sd.ref)
print(D.field['p.ref'])
sd <- sqrt(D.field$MIc*(100-D.field$MIc)/D.field$N.treat)
D.field$CI.lower <- D.field$MIc+qnorm(0.025)*sd
D.field$CI.upper <- D.field$MIc+qnorm(0.975)*sd
print(D.field[c('CI.lower', 'CI.upper')])
D.field <- D[c('zone.1', 'zone.2', 'zone.3'),]
MIc.field <- D.field[['MIc']]
MI.ref <- 99
t.test(MIc.field, mu=MI.ref, alternative ="less")
MIc.lab
N.lab <- round(D['laboratory','N.treat']*c(MIc.lab, 100-MIc.lab)/100)
for (j in 1:3) {
N.zonej <- round(N.treat[j]*c(MIc[j], 100-MIc[j])/100)
print(fisher.test(matrix(c(N.lab,N.zonej),nrow=2))$p.value)
}
D['laboratory','N.treat']
N.lab <- round(D['laboratory','N.treat']*c(MIc.lab, 100-MIc.lab)/100)
N.lab <- round(D['laboratory','N.treat']*c(MIc.lab, 100-MIc.lab)/100)
for (j in 1:3) {
N.zonej <- round(D.field$N.treat[j]*c(MIc[j], 100-MIc[j])/100)
print(fisher.test(matrix(c(N.lab,N.zonej),nrow=2))$p.value)
}
D.field$N.treat
MIc
N.lab <- round(D['laboratory','N.treat']*c(MIc.lab, 100-MIc.lab)/100)
for (j in 1:3) {
N.zonej <- round(D.field$N.treat[j]*c(MIc.field[j], 100-MIc.field[j])/100)
print(fisher.test(matrix(c(N.lab,N.zonej),nrow=2))$p.value)
}
N.lab <- round(D['laboratory','N.treat']*c(MIc.lab, 100-MIc.lab)/100)
for (j in 1:3) {
N.zonej <- round(D.field$N.treat[j]*c(MIc.field[j], 100-MIc.field[j])/100)
D.field$fisher.p[j] <- fisher.test(matrix(c(N.lab,N.zonej),nrow=2))$p.value
}
N.lab <- round(D['laboratory','N.treat']*c(MIc.lab, 100-MIc.lab)/100)
for (j in 1:3) {
N.zonej <- round(D.field$N.treat[j]*c(MIc.field[j], 100-MIc.field[j])/100)
D.field$fisher.p[j] <- Fisher.test(matrix(c(N.lab,N.zonej),nrow=2))$p.value
}
N.lab <- round(D['laboratory','N.treat']*c(MIc.lab, 100-MIc.lab)/100)
for (j in 1:3) {
N.zonej <- round(D.field$N.treat[j]*c(MIc.field[j], 100-MIc.field[j])/100)
D.field$Fisher.p[j] <- fisher.test(matrix(c(N.lab,N.zonej),nrow=2))$p.value
}
print(D.field['Fisher.p'])
D <- data.frame(N.control = c(175, 159, 160, 157),
N.treatment   = c(1048, 1111, 1174, 654),
MI.control = c(1.71, 15.09, 6.25, 14.01),
MI.treatment  = c(91.79, 97.03, 94.63, 98.01))
row.names(D) <- c("zone.1", "zone.2", "zone.3", "laboratory")
print(D)
D['MIc'] <- round((1 - (1-D$MI.treatment/100)/(1-D$MI.control/100))*100,2)
print(D['MIc'])
D.field <- D[c('zone.1', 'zone.2', 'zone.3'),]
MIc.field <- D.field[['MIc']]
MI.ref <- 99
t.test(MIc.field, mu=MI.ref, alternative ="less")
power.t.test(n=3, delta=5, sd=0.7, alternative="one-sided")
power.t.test(n=3, delta=5, sd=0.7, alternative="one.sided")
power.t.test(n=3, delta=5, sd=0.7, alternative="one.sided")
?power.t.test
power.t.test(n=3, delta=5, sd=0.7, alternative="one-sided", type ="one.sample")
power.t.test(n=3, delta=5, sd=0.7, alternative="one.sided", type ="one.sample")
power.t.test(n=3, delta=2, sd=0.7, alternative="one.sided", type ="one.sample")
power.t.test(n=3, delta=-2, sd=0.7, alternative="one.sided", type ="one.sample")
power.t.test(n=3, delta=-5, sd=0.7, alternative="one.sided", type ="one.sample")
power.t.test(n=3, delta=1, sd=0.7, alternative="one.sided", type ="one.sample")
power.t.test(n=3, delta=2, sd=0.7, alternative="one.sided", type ="one.sample")
sd(MIc.field)
power.t.test(n=3, delta=5, sd=2.4, alternative="one.sided", type ="one.sample")
power.t.test(n=3, delta=6, sd=2.4, alternative="one.sided", type ="one.sample")
power.t.test(n=3, delta=4, sd=2.4, alternative="one.sided", type ="one.sample")
power.t.test(n=3, delta=5, sd=2.4, alternative="one.sided", type ="one.sample")
power.t.test(n=3, delta=5, sd=2.4, alternative="one.sided")
power.t.test(n=3, delta=4, sd=2.4, alternative="one.sided", type ="one.sample")
power.t.test(n=3, delta=3, sd=2.4, alternative="one.sided", type ="one.sample")
t.test(MIc.field, mu=91, alternative ="greater")
warfPK.res2 <- buildmlx(project=warfPK.project, covToTest = "wt", print=FALSE)
library(ggplot2)
theme_set(theme_bw())
knitr::opts_chunk$set(warning=FALSE, message=FALSE)
library(Rsmlx)
library(lixoftConnectors)
warfPK.project <- "projects/warfarinPK.mlxtran"
warfPK.res1 <- buildmlx(warfPK.project)
print(names(warfPK.res1))
print(warfPK.res1$project)
print(warfPK.res1$covariate.model)
print(warfPK.res1$correlation)
print(warfPK.res1$error)
warfPK.res2 <- buildmlx(project=warfPK.project, covToTest = "wt", print=FALSE)
print(warfPK.res2$covariate.model)
x1=90.9746
x2=950.6794
x1+(x2-x1)/5000
x1+(x2-x1)/4999
packageVersion("mlxR")
initMlxR()
library(mlxR)
initMlxR()
r=initMlxR()
r
library(mlxR)
theme_set(theme_bw())
htmltools::includeHTML("macros.txt")
knitr::opts_chunk$set(warning=FALSE, message=FALSE)
r=initMlxR()
print(r)
initMlxR("C:/ProgramData/Lixoft/MonolixSuite2018R2")
print(1234)
library(lixoftConnectors)
?initializeLixoftConnectors
N <- 1000
sim.weight <- data.frame(id=1:N, WEIGHT=rlnorm(N, log(70), 0.2))
out.Cc  <- list(name = 'Cc', time = 0:120)
Dose.perkg <- c(1, 2, 3)
Dose.times  <- seq(from = 0, to = 72, by = 6)
nb.times <- length(Dose.times)
g <- list()
nb.group <- length(Dose.perkg)
for (k in (1:nb.group)) {
trt.k <- data.frame(id     = rep(1:N,each=nb.times),
time   = rep(Dose.times,N),
amount = rep(Dose.perkg[k]*sim.weight,each=nb.times))
g[k] <- list(treatment = trt.k, size=N)
}
g <- list()
nb.group <- length(Dose.perkg)
for (k in (1:nb.group)) {
trt.k <- data.frame(id     = rep(1:N,each=nb.times),
time   = rep(Dose.times,N),
amount = rep(Dose.perkg[k]*sim.weight,each=nb.times))
g[[k]] <- list(treatment = trt.k, size=N)
}
res <- simulx(project   = project.file,
group     = g,
output    = out.Cc)
library(mlxR)
theme_set(theme_bw())
project.file <- 'monolixRuns/theophylline_project.mlxtran'
setwd("C:/Users/Marc/OneDrive/websimulx/mlxR40/R/caseStudies")
N <- 1000
sim.weight <- data.frame(id=1:N, WEIGHT=rlnorm(N, log(70), 0.2))
out.Cc  <- list(name = 'Cc', time = 0:120)
Dose.times  <- seq(from = 0, to = 72, by = 6)
nb.times <- length(Dose.times)
Dose.perkg <- c(1, 2, 3)
nb.group <- length(Dose.perkg)
g <- list()
for (k in (1:nb.group)) {
trt.k <- data.frame(id     = rep(1:N,each=nb.times),
time   = rep(Dose.times,N),
amount = rep(Dose.perkg[k]*sim.weight,each=nb.times))
g[[k]] <- list(treatment = trt.k, size=N)
}
res <- simulx(project   = project.file,
group     = g,
output    = out.Cc)
res
N <- 100
sim.weight <- data.frame(id=1:N, WEIGHT=rlnorm(N, log(70), 0.2))
out.Cc  <- list(name = 'Cc', time = 0:100)
Dose.times  <- seq(from = 0, to = 72, by = 6)
nb.times <- length(Dose.times)
Dose.perkg <- c(1, 2)
nb.group <- length(Dose.perkg)
g <- list()
for (k in (1:nb.group)) {
trt.k <- data.frame(id     = rep(1:N,each=nb.times),
time   = rep(Dose.times,N),
amount = rep(Dose.perkg[k]*sim.weight,each=nb.times))
g[[k]] <- list(treatment = trt.k, size=N)
}
res <- simulx(project   = project.file,
group     = g,
output    = out.Cc)
head(g$trt.k)
head(g[[1]$trt.k)
head(g[[1]]$trt.k)
head(g[[1]]$treatment)
trt.k
head(trt.k)
trt.k <- data.frame(id     = rep(1:N,each=nb.times),
time   = rep(Dose.times,N),
amount = rep(Dose.perkg[k]*sim.weight$WEIGHT,each=nb.times))
trt.k
g <- list()
for (k in (1:nb.group)) {
trt.k <- data.frame(id     = rep(1:N,each=nb.times),
time   = rep(Dose.times,N),
amount = rep(round(Dose.perkg[k]*sim.weight$WEIGHT),each=nb.times))
g[[k]] <- list(treatment = trt.k, parameter=sim.weight)
}
res <- simulx(project   = project.file,
group     = g,
output    = out.Cc)
g <- list()
for (k in (1:nb.group)) {
trt.k <- data.frame(id     = rep(1:N,each=nb.times),
time   = rep(Dose.times,N),
amount = rep(round(Dose.perkg[k]*sim.weight$WEIGHT),each=nb.times))
g[[k]] <- list(treatment = trt.k, parameter=sim.weight, size=N)
}
res <- simulx(project   = project.file,
group     = g,
output    = out.Cc)
g <- list()
for (k in (1:nb.group)) {
trt.k <- data.frame(id     = rep(1:N,each=nb.times),
time   = rep(Dose.times,N),
amount = rep(round(Dose.perkg[k]*sim.weight$WEIGHT),each=nb.times))
g[[k]] <- list(treatment = trt.k, size=N)
}
res <- simulx(project   = project.file,
group     = g,
parameter=sim.weight,
output    = out.Cc)
names(res)
dim(res$Cc)
head(res$Cc)
pl <- prctilemlx(res$Cc)
pl
prctilemlx(res$Cc)
?prctilemlx
pl <- prctilemlx(res$Cc, number = 3, level = 90, labels = c("1 mg/kg", "2 mg/kg"))
print(pl)
pl <- prctilemlx(res$Cc, number = 2, level = 90, labels = c("1 mg/kg", "2 mg/kg"))
print(pl)
sim.param <- c(b=0, omega_V=0, omega_ka=0, omega_Cl=0, WEIGHT=70)
out  <- list(name = 'Cc', time = seq(0, 25, by=0.1))
sim.res2  <- simulx(project   = project.file,
output    = out,
group     = list(size=1)
parameter = sim.param)
sim.res2  <- simulx(project   = project.file,
output    = out,
group     = list(size=1),
parameter = sim.param)
print(ggplot() +
geom_line(data=sim.res2b$Cc, aes(x=time, y=Cc, colour=id)) +
scale_x_continuous("Time") + scale_y_continuous("Concentration"))
sim.res2b  <- simulx(project   = project.file,
output    = out,
group     = list(size=1),
parameter = sim.param)
print(ggplot() +
geom_line(data=sim.res2b$Cc, aes(x=time, y=Cc, colour=id)) +
scale_x_continuous("Time") + scale_y_continuous("Concentration"))
print(ggplot() +
geom_line(data=sim.res2b$Cc, aes(x=time, y=Cc)) +
scale_x_continuous("Time") + scale_y_continuous("Concentration"))
sim.param <- c(omega_V=0, omega_ka=0, omega_Cl=0, WEIGHT=70)
out  <- list(name = 'Cc', time = seq(0, 25, by=0.1))
sim.res2b  <- simulx(project   = project.file,
output    = out,
group     = list(size=10),
parameter = sim.param)
print(ggplot() +
geom_line(data=sim.res2b$Cc, aes(x=time, y=Cc)) +
scale_x_continuous("Time") + scale_y_continuous("Predicted concentration"))
sim.res2b
WEIGHT <- 70
out.Cc  <- list(name = 'Cc', time = 0:100)
Dose.times  <- seq(from = 0, to = 72, by = 6)
nb.times <- length(Dose.times)
Dose.perkg <- c(1, 2)
nb.group <- length(Dose.perkg)
g <- list()
for (k in (1:nb.group)) {
trt.k <- list(time = rep(Dose.times,N), amount = round(Dose.perkg[k]*WEIGHT))
g[[k]] <- list(treatment = trt.k, size=1)
}
sim.param <- c(omega_V=0, omega_ka=0, omega_Cl=0)
res <- simulx(project   = project.file,
group     = g,
parameter = sim.param,
output    = out.Cc)
print(ggplot() +
geom_line(data=sim.res2b$Cc, aes(x=time, y=Cc, colour=group)) +
scale_y_continuous("predicted concentration"))
print(ggplot() +
geom_line(data=res$Cc, aes(x=time, y=Cc, colour=group)) +
scale_y_continuous("predicted concentration"))
out.Cc  <- list(name = 'Cc', time = seq(0,100,by=0.2))
res <- simulx(project   = project.file,
group     = g,
parameter = sim.param,
output    = out.Cc)
print(ggplot() +
geom_line(data=res$Cc, aes(x=time, y=Cc, colour=group)) +
scale_y_continuous("predicted concentration"))
Dose.perkg <- c(1.5, 2, 2.5)
nb.group <- length(Dose.perkg)
g <- list()
for (k in (1:nb.group)) {
trt.k <- list(time = rep(Dose.times,N), amount = round(Dose.perkg[k]*WEIGHT))
g[[k]] <- list(treatment = trt.k, size=1)
}
res <- simulx(project   = project.file,
group     = g,
parameter = sim.param,
output    = out.Cc)
print(ggplot() + geom_line(data=res$Cc, aes(x=time, y=Cc, colour=group)) +
scale_y_continuous("predicted concentration"))
pl <- ggplot(data=res$Cc, ) + geom_line(aes(x=time, y=Cc, colour=group)) +  scale_y_continuous("predicted concentration") +
scale_colour_discrete(name  ="Dose", breaks=c("1", "2", "3"), labels=c("1.5 mg/kg", "2 mg/kg", "2.5 mg/kg"))
print(pl)
sim.param <- c(omega_V=0, omega_ka=0, omega_Cl=0)
WEIGHT <- 70
out.Cc  <- list(name = 'Cc', time = seq(0,100,by=0.2))
Dose.times  <- seq(from = 0, to = 72, by = 6)
nb.times <- length(Dose.times)
Dose.perkg <- c(1.5, 2, 2.5)
nb.group <- length(Dose.perkg)
g <- list()
for (k in (1:nb.group)) {
trt.k <- list(time = rep(Dose.times,N), amount = round(Dose.perkg[k]*WEIGHT))
g[[k]] <- list(treatment = trt.k, size=1)
}
res <- simulx(project   = project.file,
group     = g,
parameter = sim.param,
output    = out.Cc)
pl <- ggplot(data=res$Cc, ) + geom_line(aes(x=time, y=Cc, colour=group)) +  scale_y_continuous("predicted concentration") +
scale_colour_discrete(name  ="Dose", breaks=c("1", "2", "3"), labels=c("1.5 mg/kg", "2 mg/kg", "2.5 mg/kg"))
print(pl)
print(pl)
pl <- ggplot(data=res$Cc, ) + geom_line(aes(x=time, y=Cc, colour=group)) +  scale_y_continuous("predicted concentration") +
scale_colour_discrete(name  ="Dose",  labels=c("1.5 mg/kg", "2 mg/kg", "2.5 mg/kg"))
print(pl)
res <- simulx(project   = project.file,
group     = g,
parameter = sim.param,
output    = out.Cc)
pl <- ggplot(data=res$Cc, ) + geom_line(aes(x=time, y=Cc, colour=group)) +  scale_y_continuous("predicted concentration") +
scale_colour_discrete(name  ="Dose",  labels=c("1.5 mg/kg", "2 mg/kg", "2.5 mg/kg"))
print(pl)
sim.param
sim.param <- c(omega_V=0, omega_ka=0, omega_Cl=0, WEIGHT=70)
res <- simulx(project   = project.file,
group     = g,
parameter = sim.param,
output    = out.Cc)
pl <- ggplot(data=res$Cc, ) + geom_line(aes(x=time, y=Cc, colour=group)) +  scale_y_continuous("predicted concentration") +
scale_colour_discrete(name  ="Dose",  labels=c("1.5 mg/kg", "2 mg/kg", "2.5 mg/kg"))
print(pl)
res <- simulx(project   = project.file,
group     = g,
parameter = sim.param,
output    = out.Cc)
pl <- ggplot(data=res$Cc, ) + geom_line(aes(x=time, y=Cc, colour=group)) +  scale_y_continuous("predicted concentration") +
scale_colour_discrete(name  ="Dose",  labels=c("1.5 mg/kg", "2 mg/kg", "2.5 mg/kg"))
print(pl)
sim.param <- c(omega_V=0, omega_ka=0, omega_Cl=0, WEIGHT=70)
out.Cc  <- list(name = 'Cc', time = seq(0,100,by=0.2))
Dose.times  <- seq(from = 0, to = 72, by = 6)
nb.times <- length(Dose.times)
Dose.perkg <- c(1.5, 2, 2.5)
nb.group <- length(Dose.perkg)
g <- list()
for (k in (1:nb.group)) {
trt.k <- list(time = rep(Dose.times,N), amount = round(Dose.perkg[k]*WEIGHT))
g[[k]] <- list(treatment = trt.k, size=1)
}
res <- simulx(project   = project.file,
group     = g,
parameter = sim.param,
output    = out.Cc)
pl <- ggplot(data=res$Cc, ) + geom_line(aes(x=time, y=Cc, colour=group)) +  scale_y_continuous("predicted concentration") +
scale_colour_discrete(name  ="Dose", breaks=c("1", "2", "3"), labels=c("1.5 mg/kg", "2 mg/kg", "2.5 mg/kg"))
print(pl)
print(pl)
WEIGHT = 70
sim.param <- c(omega_V=0, omega_ka=0, omega_Cl=0, WEIGHT=WEIGHT)
out.Cc  <- list(name = 'Cc', time = seq(0,100,by=0.2))
Dose.times  <- seq(from = 0, to = 72, by = 6)
nb.times <- length(Dose.times)
Dose.perkg <- c(1.5, 2, 2.5)
nb.group <- length(Dose.perkg)
g <- list()
for (k in (1:nb.group)) {
trt.k <- list(time = rep(Dose.times,N), amount = round(Dose.perkg[k]*WEIGHT))
g[[k]] <- list(treatment = trt.k, size=1)
}
res <- simulx(project   = project.file,
group     = g,
parameter = sim.param,
output    = out.Cc)
pl <- ggplot(data=res$Cc, ) + geom_line(aes(x=time, y=Cc, colour=group)) +  scale_y_continuous("predicted concentration") +
scale_colour_discrete(name  ="Dose", breaks=c("1", "2", "3"), labels=c("1.5 mg/kg", "2 mg/kg", "2.5 mg/kg"))
print(pl)
